<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>Javascript This | dmf的个人博客</title><meta name="author" content="dmf"><meta name="copyright" content="dmf"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="描述">
<meta property="og:type" content="article">
<meta property="og:title" content="Javascript This">
<meta property="og:url" content="https://gitee.com/dmf-c/blog/2021/08/29/js_file/This/index.html">
<meta property="og:site_name" content="dmf的个人博客">
<meta property="og:description" content="描述">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img1.baidu.com/it/u=3691791879,443411760&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889">
<meta property="article:published_time" content="2021-08-28T16:00:00.000Z">
<meta property="article:modified_time" content="2022-10-12T07:31:19.580Z">
<meta property="article:author" content="dmf">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://img1.baidu.com/it/u=3691791879,443411760&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889"><link rel="shortcut icon" href="/blog/img/favicon.png"><link rel="canonical" href="https://gitee.com/dmf-c/blog/2021/08/29/js_file/This/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/blog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/blog/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Javascript This',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-10-12 15:31:19'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">27</div></a><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/blog/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/blog/"><i class="fa-fw iconfont icon-shouyex"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw iconfont icon-zuixinwenzhang_huaban"></i><span> 找文章</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/blog/categories/"><i class="fa-fw iconfont icon-fenlei1"></i><span> 分类</span></a></li><li><a class="site-page child" href="/blog/tags/"><i class="fa-fw iconfont icon-biaoqian1"></i><span> 标签</span></a></li><li><a class="site-page child" href="/blog/archives/"><i class="fa-fw iconfont icon-shijianzhou"></i><span> 归档</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://img1.baidu.com/it/u=3691791879,443411760&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=500&amp;h=889')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/blog/">dmf的个人博客</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/blog/"><i class="fa-fw iconfont icon-shouyex"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw iconfont icon-zuixinwenzhang_huaban"></i><span> 找文章</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/blog/categories/"><i class="fa-fw iconfont icon-fenlei1"></i><span> 分类</span></a></li><li><a class="site-page child" href="/blog/tags/"><i class="fa-fw iconfont icon-biaoqian1"></i><span> 标签</span></a></li><li><a class="site-page child" href="/blog/archives/"><i class="fa-fw iconfont icon-shijianzhou"></i><span> 归档</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Javascript This</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="fa-fw post-meta-icon far fa-calendar-alt"></i><span class="post-meta-label">发表于</span><time datetime="2021-08-28T16:00:00.000Z" title="发表于 2021-08-29 00:00:00">2021-08-29</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/blog/categories/Javascript/">Javascript</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Javascript This"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="了解this"><a href="#了解this" class="headerlink" title="了解this"></a>了解this</h2><p>随着函数使用场合的不同，this的值会发生变化。但总有一条原则就是<strong>JS中的this代表的是当前行为执行的主体</strong>，在JS中主要研究的都是函数中的this，但并不是说只有在函数里才有this，<strong>this实际上是在函数被调用时发生的绑定，它指向什么完全取决于函数在哪里被调用。</strong></p>
<h2 id="this的几种常见情况"><a href="#this的几种常见情况" class="headerlink" title="this的几种常见情况"></a>this的几种常见情况</h2><p><strong>1. 函数执行时首先看函数名前面是否有”.”，有的话，”.”前面是谁,this就是谁；没有的话this就是window</strong></p>
<pre><code>function fn()&#123;
console.log(this);
&#125;
var obj=&#123;fn:fn&#125;;
fn();//this-&gt;window
obj.fn();//this-&gt;obj
function sum()&#123;
    fn();//this-&gt;window
&#125;
sum();
var oo=&#123;
sum:function()&#123;
console.log(this);//this-&gt;oo
    fn()；//this-&gt;window
&#125;
&#125;;
oo.sum();
</code></pre>
<p><strong>2. 自执行函数中的this永远是window</strong></p>
<pre><code>(function()&#123; //this-&gt;window &#125;)();
~function()&#123; //this-&gt;window &#125;();
</code></pre>
<p><strong>3. 给元素的某一个事件绑定方法，当事件触发的时候，执行对应的方法，方法中的this是当前的元素，除了IE6~8下使用attachEvent）</strong></p>
<ul>
<li><p>DOM零级事件绑定</p>
<pre><code>  oDiv.onclick=function()&#123;
      //this-&gt;oDiv
  &#125;;
</code></pre>
</li>
<li><p>DOM二级事件绑定</p>
<pre><code>  oDiv.addEventListener(&quot;click&quot;,function()&#123;
      //this-&gt;oDiv
  &#125;,false);
</code></pre>
</li>
<li><p>在IE6~8下使用attachEvent，默认的this就是指的window对象</p>
<pre><code>  oDiv.attachEvent(&quot;click&quot;,function()&#123;
      //this-&gt;window
  &#125;);
</code></pre>
</li>
</ul>
<p><strong>4. 在构造函数模式中，类中(函数体中)出现的this.xxx&#x3D;xxx中的this是当前类的一个实例</strong></p>
<pre><code>function CreateJsPerson(name,age)&#123;
//浏览器默认创建的对象就是我们的实例p1-&gt;this
this.name=name;//-&gt;p1.name=name
this.age=age;
this.writeJs=function（）&#123;
console.log(&quot;my name is&quot;+this.name +&quot;,i can write Js&quot;);
&#125;;
//浏览器再把创建的实例默认的进行返回
&#125;
var p1=new CreateJsPerson(&quot;沸羊羊&quot;,48);
</code></pre>
<p><strong>类中某一个属性值(方法)，方法中的this需要看方法执行的时候，前面是否有”.”,才能知道this是谁。</strong></p>
<pre><code>function Fn()&#123;
this.x=100；//this-&gt;f1
this.getX=function()&#123;
console.log(this.x);//this-&gt;需要看getX执行的时候才知道
&#125;
&#125;
var f1=new Fn;
f1.getX();//-&gt;方法中的this是f1，所以f1.x=100
var ss=f1.getX;
ss();//-&gt;方法中的this是window -&gt;undefined
</code></pre>
<p><strong>5. call、apply和bind</strong></p>
<p>先来看一个问题，下面的例子中this绑定obj,怎么实现？</p>
<pre><code>var obj=&#123;name:&quot;沸羊羊&quot;&#125;;
function fn()&#123;
console.log(this);//this=&gt;window
&#125;
fn();
obj.fn();//-&gt;Uncaught TypeError:obj.fn is not a function
</code></pre>
<p>如果直接绑定obj.fn()会报错。这里应该用fn.call(obj)就可以实现this绑定obj。</p>
<p><strong>call方法的作用:</strong></p>
<p><strong>1. 首先我们让原型上的call方法执行，在执行call方法的时候，我们让fn方法中的this变为第一个参数值obj；然后再把fn这个函数执行。</strong></p>
<p><strong>2. call还可以传值，在严格模式下和非严格模式下，得到值不一样。</strong></p>
<pre><code>//在非严格模式下
var obj=&#123;name:&quot;浪里行舟 &quot;&#125;;
function fn(num1,num2)&#123;
console.log(num1+num2);
console.log(this);
&#125;
fn.call(100,200);//this-&gt;100 num1=200 num2=undefined
fn.call(obj,100,200);//this-&gt;obj num1=100 num2=200
fn.call();//this-&gt;window
fn.call(null);//this-&gt;window
fn.call(undefined);//this-&gt;window

//严格模式下 
fn.call();//在严格模式下this-&gt;undefined
fn.call(null);// 在严格模式 下this-&gt;null
fn.call(undefined);//在严格模式下this-&gt;undefined
</code></pre>
<ul>
<li><strong>apply和call方法的作用是一模一样的，都是用来改变方法的this关键字并且把方法执行，而且在严格模式下和非严格模式下对于第一个参数是null&#x2F;undefined这种情况的规律也一样。</strong></li>
</ul>
<p>两者唯一的区别：call在给fn传递参数的时候，是一个个的传递值的，而apply不是一个个传，而是把要给fn传递的参数值统一的放在一个数组中进行操作。但是也相当子一个个的给fn的形参赋值。总结一句话:<strong>call第二个参数开始接受一个参数列表,apply第二个参数开始接受一个参数数组</strong></p>
<pre><code>fn.call(obj,100,200);
fn.apply(obj,[100,200]);
</code></pre>
<ul>
<li><p><strong>bind：这个方法在IE6～8下不兼容，和call&#x2F;apply类似都是用来改变this关键字的</strong>，但是和这两者有明显区别：</p>
<pre><code>  fn.call(obj,1,2);//-&gt;改变this和执行fn函数是一起都完成了
  fn.bind(obj,1,2);//-&gt;只是改变了fn中的this为obj，并且给fn传递了两个参数值1、2，
                      但是此时并没有把fn这个函数执行
  var tempFn=fn.bind(obj,1,2);
  tempFn(); //这样才把fn这个函数执行
</code></pre>
</li>
</ul>
<p><strong>bind体现了预处理思想：事先把fn的this改变为我们想要的结果，并且把对应的参数值也准备好，以后要用到了，直接的执行即可。</strong></p>
<p><strong>call和apply直接执行函数，而bind需要再一次调用。</strong></p>
<pre><code>var a =&#123;
        name : &quot;Cherry&quot;,
        fn : function (a,b) &#123;
            console.log( a + b)
        &#125;
    &#125;
var b = a.fn;
b.bind(a,1,2)
</code></pre>
<p>上述代码没有执行，bind返回改变了上下文的一个函数，我们必须要手动去调用：</p>
<pre><code>b.bind(a,1,2)() //3
</code></pre>
<p><strong>必须要声明一点：遇到第五种情况（call apply和bind),前面四种全部让步。</strong></p>
<h2 id="箭头函数this指向"><a href="#箭头函数this指向" class="headerlink" title="箭头函数this指向"></a>箭头函数this指向</h2><p><strong>更简短的函数并且不绑定this。</strong></p>
<pre><code>var obj = &#123;
    birth: 1990,
    getAge: function () &#123;
        var b = this.birth; // 1990
        var fn = function () &#123;
            return new Date().getFullYear() - this.birth; // this指向window或undefined
        &#125;;
        return fn();
    &#125;
&#125;;
</code></pre>
<p><strong>箭头函数没有自己的this，箭头函数的this不是调用的时候决定的，而是在定义的时候处在的对象就是它的this。</strong></p>
<p><strong>箭头函数的this看外层的是否有函数，如果有，外层函数的this就是内部箭头函数的this，如果没有，则this是window。</strong></p>
<pre><code>&lt;button id=&quot;btn1&quot;&gt;测试箭头函数this_1&lt;/button&gt;
&lt;button id=&quot;btn2&quot;&gt;测试箭头函数this_2&lt;/button&gt;
&lt;script type=&quot;text/javascript&quot;&gt;   
    let btn1 = document.getElementById(&#39;btn1&#39;);
    let obj = &#123;
        name: &#39;kobe&#39;,
        age: 39,
        getName: function () &#123;
            btn1.onclick = () =&gt; &#123;
                console.log(this);//obj
            &#125;;
        &#125;
    &#125;;
    obj.getName();
&lt;/script&gt;
</code></pre>
<p>上例中，由于箭头函数不会创建自己的this,它只会从自己的作用域链的上一层继承this。可以简化为如下代码:</p>
<pre><code>let btn1 = document.getElementById(&#39;btn1&#39;);
        let obj = &#123;
            name: &#39;kobe&#39;,
            age: 39,
            getName: function () &#123;
                console.log(this)
            &#125;
        &#125;;
obj.getName();
</code></pre>
<p>假如上一层并不存在函数，this指向又是谁？</p>
<pre><code>&lt;button id=&quot;btn1&quot;&gt;测试箭头函数this_1&lt;/button&gt;
&lt;button id=&quot;btn2&quot;&gt;测试箭头函数this_2&lt;/button&gt;
&lt;script type=&quot;text/javascript&quot;&gt;   
    let btn2 = document.getElementById(&#39;btn2&#39;);
    let obj = &#123;
        name: &#39;kobe&#39;,
        age: 39,
        getName: () =&gt; &#123;
            btn2.onclick = () =&gt; &#123;
                console.log(this);//window
            &#125;;
        &#125;
    &#125;;
    obj.getName();
&lt;/script&gt;
</code></pre>
<p>上例中，虽然存在两个箭头函数，其实this取决于最外层的箭头函数,由于obj是个对象而非函数，所以this指向为Window对象</p>
<p>由于this在箭头函数中已经按照词法作用域绑定了，所以，<strong>用call()或者apply()调用箭头函数时，无法对this进行绑定，即传入的第一个参数被忽略：</strong></p>
<pre><code>var obj = &#123;
    birth: 1990,
    getAge: function (year) &#123;
        var b = this.birth; // 1990
        var fn = (y) =&gt; y - this.birth; // this.birth仍是1990
        return fn.call(&#123;birth:2000&#125;, year);
    &#125;
&#125;;
obj.getAge(2018); // 28
</code></pre>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://gitee.com/dmf-c/blog">dmf</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://gitee.com/dmf-c/blog/2021/08/29/js_file/This/">https://gitee.com/dmf-c/blog/2021/08/29/js_file/This/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://gitee.com/dmf-c/blog" target="_blank">dmf的个人博客</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://img1.baidu.com/it/u=3691791879,443411760&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=500&amp;h=889" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/blog/2021/09/12/js_file/PrototypeChain/"><img class="prev-cover" src="https://img1.baidu.com/it/u=3691791879,443411760&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=500&amp;h=889" onerror="onerror=null;src='/blog/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">原型与原型链</div></div></a></div><div class="next-post pull-right"><a href="/blog/2021/08/14/js_file/Closure/"><img class="next-cover" src="https://img1.baidu.com/it/u=3691791879,443411760&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=500&amp;h=889" onerror="onerror=null;src='/blog/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Javascript闭包</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/blog/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">dmf</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">27</div></a><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/blog/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">业精于勤，荒于嬉。</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%86%E8%A7%A3this"><span class="toc-number">1.</span> <span class="toc-text">了解this</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#this%E7%9A%84%E5%87%A0%E7%A7%8D%E5%B8%B8%E8%A7%81%E6%83%85%E5%86%B5"><span class="toc-number">2.</span> <span class="toc-text">this的几种常见情况</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AE%AD%E5%A4%B4%E5%87%BD%E6%95%B0this%E6%8C%87%E5%90%91"><span class="toc-number">3.</span> <span class="toc-text">箭头函数this指向</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/blog/2023/01/08/vue_file/vuenote/" title="vue3入门笔记"><img src="https://img1.baidu.com/it/u=1828439677,2166285235&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=400&amp;h=300" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="vue3入门笔记"/></a><div class="content"><a class="title" href="/blog/2023/01/08/vue_file/vuenote/" title="vue3入门笔记">vue3入门笔记</a><time datetime="2023-01-07T16:00:00.000Z" title="发表于 2023-01-08 00:00:00">2023-01-08</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2022/02/20/vue_file/comm/" title="vue组件间通信六种方式"><img src="https://img1.baidu.com/it/u=1828439677,2166285235&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=400&amp;h=300" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="vue组件间通信六种方式"/></a><div class="content"><a class="title" href="/blog/2022/02/20/vue_file/comm/" title="vue组件间通信六种方式">vue组件间通信六种方式</a><time datetime="2022-02-19T16:00:00.000Z" title="发表于 2022-02-20 00:00:00">2022-02-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2022/02/05/wxEcharts/" title="微信小程序使用 echarts"><img src="https://img1.baidu.com/it/u=1828439677,2166285235&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=400&amp;h=300" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="微信小程序使用 echarts"/></a><div class="content"><a class="title" href="/blog/2022/02/05/wxEcharts/" title="微信小程序使用 echarts">微信小程序使用 echarts</a><time datetime="2022-02-04T16:00:00.000Z" title="发表于 2022-02-05 00:00:00">2022-02-05</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2022/01/30/vue_file/vue_router/" title="vue-router学习"><img src="https://img1.baidu.com/it/u=1828439677,2166285235&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=400&amp;h=300" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="vue-router学习"/></a><div class="content"><a class="title" href="/blog/2022/01/30/vue_file/vue_router/" title="vue-router学习">vue-router学习</a><time datetime="2022-01-29T16:00:00.000Z" title="发表于 2022-01-30 00:00:00">2022-01-30</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2022/01/16/vue_file/vuex/" title="Vuex使用方法"><img src="https://img1.baidu.com/it/u=1828439677,2166285235&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=400&amp;h=300" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="Vuex使用方法"/></a><div class="content"><a class="title" href="/blog/2022/01/16/vue_file/vuex/" title="Vuex使用方法">Vuex使用方法</a><time datetime="2022-01-15T16:00:00.000Z" title="发表于 2022-01-16 00:00:00">2022-01-16</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By dmf</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/blog/js/utils.js"></script><script src="/blog/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>